﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HenIT.BizTalk.Objects
{
    public class DateTimeMatch
    {
        public bool Match { get; set; }
        private DateTime dtValue;
        public DateTime Value
        {
            get { return dtValue; }
            set
            {
                dtValue = value;
                Match = value == dtValue2;
            }
        }
        private DateTime dtValue2;
        public DateTime Value2
        {
            get { return dtValue2; }
            set
            {
                dtValue2 = value;
                Match = dtValue == dtValue2;
            }
        }

        public DateTimeMatch(DateTime value)
        {
            Value = value;
        }

        public override string ToString()
        {
            return dtValue.ToString();
        }

        #region IComparable Members
        public int CompareTo(object obj)
        {
            return CompareTo((DateTimeMatch)obj);
        }
        public int CompareTo(DateTimeMatch obj)
        {
            return Value.CompareTo(obj.Value);
        }
        #endregion
    }
}
